package com.hins.component.hlock.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author Leslie
 * @date 2021/9/7 9:37
 */
@Data
@ConfigurationProperties(prefix = HlockConfig.PREFIX)
public class HlockConfig {

    public static final String PREFIX = "spring.hlock";

    /**
     * redisson
     */
    private String address;
    private String password;
    private int database=15;
    private ClusterServer clusterServer;
    private String codec = "org.redisson.codec.JsonJacksonCodec";

    /**
     * com.hins.component.hlock.lock
     */
    private long waitTime = 60;
    private long leaseTime = 60;


    @Data
    public static class ClusterServer{

        private String[] nodeAddresses;

    }
}
